/**
 * 作者: wgx
 * 日期: 2025-04-21 11:14:06
 * 备注: 用户伤兵的恢复情况
 */
package com.motu.monstercity.server.game.userdata;

import com.motu.monstercity.server.game.base.AllParam;
import com.motu.monstercity.server.game.commondata.build.BuildBank;
import com.motu.monstercity.server.game.logic.BuildManager;
import com.motu.monstercity.server.game.logic.UnionManager;
import com.motu.vertx.module.utility.toolset.TimeUtils;

public class UserSoldierRecover extends UserSoldierRecoverModel {
    public UserSoldierRecover() {
        super();
    }

    public void reset() {
        long curTime = TimeUtils.getCurTime();
        if (curTime >= getEndTime() - getReduceTime()) {// 时间到了，才一次性全部恢复伤员
            cleanData();
            update();
        }
    }

    // 当前是否正在治疗中 false表示已经完成治疗
    public boolean isRecovering() {
        if (getSoldierTotal() > 0) {
            return true;
        } else {
            return false;
        }
    }

    // 清除数据
    public void cleanData() {
        putSoldierTotal(0);
        putType(0);
        putStartTime(0L);
        putEndTime(0L);
        putRecoverValue(0);
        putHelpDbid(0L);
        putReduceTime(0);
        putUniqeId("");
    }
}
